<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

$this->load->helper('html');
?>



<!-- JavaScript -->
<script type="text/javascript" src="<?= base_url() ?>js/wufoo.js"></script>
<script type="text/javascript">

function asal(nip) {
$.ajax ({
	url: "<?=base_url();?>index.php/gaji/asal/",
	global: false,
	type: "POST",
	async: false,
	dataType: "html",
	data: "nip="+ nip.value,
	success: function (response) {
		str = response.split(";");
		document.getElementById("suskel").value= str[0];
		document.getElementById("npwp").value= str[1];
		document.getElementById("ptkp").value= str[2];
		document.getElementById("pokok").value= str[3];
		document.getElementById("tunj_posisi").value= str[4];
		document.getElementById("tunj_transport_x").value= str[5];
		document.getElementById("makan_x").value= str[6];
//		document.former.suskel.value = str[0];
//		document.act_form.npwp.value = str[1];
	}
});
return false;
}	
	
function pesanFormat()
{
alert("PERHATIAN: \n \nUntuk menuliskan format uang harap diisi dengan angka utuh tanpa pemisah ribuan. \nUntuk menuliskan nilai dua angka dibelakang koma, gunakan titik (.) sebagai pengganti koma. \nMisal untuk menuliskan 1.000.000,00 adalah dengan 1000000.00");
}

function pesanTransport()
{
alert("PERHATIAN: \n \nHarap masukkan Tunjangan Transportasi per Harinya.");
}

function pesanMakan()
{
alert("PERHATIAN: \n \nHarap masukkan Uang Makan per Harinya.");
}

function getIDx() 
{
var nip = document.getElementById("nip").value;
document.getElementById("npwp").value= nip;
}

function hitungAbsen()
{
var hari = document.getElementById("hari_kerja").value;
var absen = document.getElementById("tdk_hadir").value;
var hasil = hari - absen ;
document.getElementById("hadir").value= hasil;
}


function hitungTM()
{
var hadir = document.getElementById("hadir").value;
var hari = document.getElementById("hari_kerja").value;
var tunj_transport_x = document.getElementById("tunj_transport_x").value;
var makan_x = document.getElementById("makan_x").value;
var hasil1 = (hadir/ hari) * tunj_transport_x;
var hasil2 = (hadir/ hari) * makan_x;
document.getElementById("tunj_transport").value= Math.round(hasil1 * 100) / 100;
document.getElementById("makan").value= Math.round(hasil2 * 100) / 100;
}

function hitungLembur()
{
var pokok = document.getElementById("pokok").value;
var tunj_posisi = document.getElementById("tunj_posisi").value;
var tunj_transport = document.getElementById("tunj_transport").value;
var makan = document.getElementById("makan").value;
var jam_hk = document.getElementById("jam_hk").value;
var jam_hl = document.getElementById("jam_hl").value;
var upah = (1/173) * (0 - pokok) * -1;
var hk1 = jam_hk * upah * 1.5;
var hk2 = (0 - (upah * 1.5) - ((jam_hk - 1) * upah * 2) ) * -1;
var hl1 = jam_hl * upah * 2;
var hl2 = (0 - ((jam_hl - 8) * upah *3) - (8 * upah * 2)) * -1;
var hl3 = (0 - ((jam_hl - 9) * upah *4) - (8 * upah * 2) - (upah * 3)) * -1;
if (jam_hk > 1) {
	var hk = hk2;
	}
else {
	var hk = hk1;
	}

if (jam_hl <= 8) {
	var hl = hl1;
	}
else if (jam_hl <=9) {
	var hl = hl2;
	}
else {
	var hl = hl3;
	}
	
var hasil = (0 - hk - hl) * -1; 
document.getElementById("lembur").value= Math.round((hasil)* 100)/100;
	
}

function hitungGK()
{
var pokok = document.getElementById("pokok").value;
var tunj_posisi = document.getElementById("tunj_posisi").value;
var tunj_transport = document.getElementById("tunj_transport").value;
var makan = document.getElementById("makan").value;
var lumpsum = document.getElementById("lumpsum").value;
var tunj_lainnya = document.getElementById("tunj_lainnya").value;
var suplisi = document.getElementById("suplisi").value;
var lembur = document.getElementById("lembur").value;
var thrk = document.getElementById("thrk").value;
var tunj_jamsostek = document.getElementById("tunj_jamsostek").value;
var hasil = (0 - pokok - tunj_posisi - tunj_transport - makan - lumpsum - tunj_lainnya - suplisi - lembur - thrk - tunj_jamsostek) * -1 ;
document.getElementById("jml_gaji_kotor").value= Math.round((hasil)* 100)/100;
}

function hitungPT()
{
var pokok = document.getElementById("pokok").value;
var jamsostek_x = document.getElementById("jamsostek_x").value;
var iuran_dplk_x = document.getElementById("iuran_dplk_x").value;
var jamsostek = Math.round(((jamsostek_x / 100) * pokok)* 100)/100;
var iuran_dplk = Math.round(((iuran_dplk_x / 100) * pokok)* 100)/100;
document.getElementById("jamsostek").value= jamsostek;
document.getElementById("iuran_dplk").value= iuran_dplk;
document.getElementById("jml_potongan_tetap").value= (0 - jamsostek - iuran_dplk) * -1;
}

function hitungNS()
{
var pokok = document.getElementById("pokok").value * 12;
var tunj_posisi = document.getElementById("tunj_posisi").value;
var tunj_transport = document.getElementById("tunj_transport").value;
var makan = document.getElementById("makan").value;
var thrk = document.getElementById("thrk").value;
var kotor = document.getElementById("jml_gaji_kotor").value;
document.getElementById("netto_setahun").value= kotor;
}

function hitungPKPth()
{
var pokok = document.getElementById("pokok").value;
var ph_bruto = document.getElementById("jml_gaji_kotor").value;
var jamsostek = document.getElementById("jamsostek").value;
var iuran_dplk = document.getElementById("iuran_dplk").value;
var ptkp = document.getElementById("ptkp").value;
var ph_brutox = pokok * 0.05;
var mk = 500000;

if ( ph_brutox < mk) 
	{
	var bj = ph_brutox;
	}
else 
	{
	var bj = mk;
	}	

document.getElementById("pkp_setahun").value= ph_bruto - bj - iuran_dplk - jamsostek;

}

function hitungPKP()
{
var ptkp = document.getElementById("ptkp").value;
var ph_netto = document.getElementById("pkp_setahun").value;

if (ph_netto < ptkp) 
	{
	var pkp_awal = 0;
	}
else 
	{
	var pkp_awal = ph_netto - ptkp;
	}

var x = pkp_awal / 1000;
var xx = Math.floor(x);
// if (xx > x) {var y = xx - x;} else {var y = x - xx;}
var xxx = x - xx;
// if (y == 0) {var xxx = 0;} else {var xxx = y;}
// var xxxx = Math.round((x - xxx)*100)/100;
// var pkp = xxxx * 1000;
document.getElementById("pkp").value = xx * 1000;
		
}

function hitungPKPbln()
{
var pkp = document.getElementById("pkp").value;
var hasil1 = (0 - ((pkp - 500000000) * 0.3) - 95000000) * -1;
var hasil2 = (0 - ((pkp - 250000000) * 0.25) - 32500000) * -1;
var hasil3 = (0 - ((pkp - 50000000) * 0.15) - 2500000) * -1;
var hasil4 = 0;
var hasil5 = pkp * 0.05;

if (pkp > 500000000) 
	{
	document.getElementById("pkp_sebulan").value= Math.round(hasil1 * 100)/100;
	}
else if (pkp > 250000000)
	{
	document.getElementById("pkp_sebulan").value= Math.round(hasil2 * 100)/100;
	}	
else if (pkp > 50000000)
	{
	document.getElementById("pkp_sebulan").value= Math.round(hasil3 * 100)/100;
	}	
else if (pkp < 0)
	{
	document.getElementById("pkp_sebulan").value= Math.round(hasil4 * 100)/100;
	}
else 
	{
	document.getElementById("pkp_sebulan").value= Math.round(hasil5 * 100)/100;
	}	
}

function hitungPKPblnX()
{
var pkp_setahun = document.getElementById("pkp_setahun").value;
document.getElementById("pkp_sebulan").value= Math.round((pkp_setahun / 12)*100)/100;
}

function hitungPPH21() 
{
var npwp = document.getElementById("npwp").value;
var pph_terutang = document.getElementById("pkp_sebulan").value;

if (npwp == "Ada" || npwp == "ada" || npwp == "ADA" || npwp == 1)
	{
	document.getElementById("pph21").value= Math.round((pph_terutang) * 100)/100; 
	}
else 
	{
	document.getElementById("pph21").value= Math.round((pph_terutang * 1.2) * 100)/100; 
	}
}

function hitungGB() 
{
var jml_gaji_kotor = document.getElementById("jml_gaji_kotor").value;
var jml_potongan_tetap = document.getElementById("jml_potongan_tetap").value;
var pph21 = document.getElementById("pph21").value;

document.getElementById("jml_gaji_bersih").value= Math.round((jml_gaji_kotor - pph21)* 100)/100;
}

function hitungPL() 
{
var simp_wajib = document.getElementById("simp_wajib").value;
var pinj_pendek = document.getElementById("pinj_pendek").value;
var pinj_panjang = document.getElementById("pinj_panjang").value;
var pinj_lain = document.getElementById("pinj_lain").value;
var potongan_lain = document.getElementById("potongan_lain").value;
document.getElementById("jml_potongan_lain").value= Math.round(((0 - simp_wajib - pinj_pendek - pinj_panjang - pinj_lain - potongan_lain) * -1)* 100)/100; 
}

function hitungGA() 
{
var jml_potongan_lain = document.getElementById("jml_potongan_lain").value;
var jml_gaji_bersih = document.getElementById("jml_gaji_bersih").value;
document.getElementById("jml_gaji_akhir").value= Math.round((jml_gaji_bersih - jml_potongan_lain) * 100)/100; 
}
// Math.round(()* 100)/100
</script>

<style type="text/css">
<!--
.gaya{	
	font-size:12px;
	text-align:right;
	font-weight: bold;
	
} 

.judul{	
	font-size:13px;
	text-align:center;
	font-weight: bold;
	background-color:black;
	border-style:solid;
} 

.gaya2{	
	font-size:14px;
	text-align:right;
	font-weight: bold;
} 

.gaya3{	
	font-size:14px;
	text-align:center;
	font-weight: bold;
	background-color:grey;
	border-style:solid;
} 

-->
</style>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />


<div id="container">
    <fieldset class="fieldset" style="height:1290px;">
        <legend class="legend">
<?
				if ($status == "detail") 
		{
		echo '| Detail Data Surat Keluar |</legend>';
		} else if ($status == "edit") {
		echo '| Edit Data Surat Keluar |</legend>';
		}
		else {
		echo '| Form Progress |</legend>';
		}
?>

        <div id="contentform" style="border:solid thin #BBBBBB; height:1260px; background-color:#F9F9F9; -moz-border-radius: 5px;  padding-top:10px; padding-bottom:0.3px; margin-right:100px; margin-left:100px;">

            <!-- Start value -->
            <?
            //Setting Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
			$value = array(
                'id_proses_aktifitas' => "",              
                'kuota_volume' => "",
				'volume_existing' => "",
                'persentase_volume' => "",
                'act_form' => "aktifitas/save_nilai".$this->session->userdata('id_status_jenis_aktifitas').""
            );			         
			
            //Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
			if ($status == "edit") {
                $value['id_proses_aktifitas'] = $id_proses_aktifitas;
                $value['kuota_volume'] = $kuota_volume;
                $value['volume_existing'] = $volume_existing;
                $value['persentase_volume'] = $persentase_volume;
                $value['act_form'] = "" . $value['id_proses_aktifitas'];
            }//end if
			            		
			 //Setting Value pada form Jika melakukan prosedur Detail.
            if ($status == "detail") {
                $value['id_proses_aktifitas'] = $id_proses_aktifitas;
                $value['kuota_volume'] = $kuota_volume;
                $value['volume_existing'] = $volume_existing;
                $value['persentase_volume'] = $persentase_volume;
                $value['act_form'] = "" . $value['id_proses_aktifitas'];
            }//end if
            ?>
			<?
			$atributes = array('name' => 'former');
			?>
            <?= form_open_multipart($value["act_form"]); ?>
            <!-- End value -->

            <table width="847" border="0" bordercolor="#F0F0F0">
                <tr>
                    <td width="905" height="150">
                        <form id="form1" name="form1" method="post">
                            <div align="center">
                                <table width="850" border="0">
									<tr>
                                        <td width="130">Nama Pegawai</td>
                                        <td width="5"></td>
										<td width="270">
										<?
											$options[Null] = "-- Pilih Pegawai --";
											foreach ($hrd->result() as $row)
											{
												$options[$row->nip] = $row->nama_lengkap;
											}
											if ($status=="detail" || $status=="edit"){
											echo form_dropdown('nip', $options, $value["nip"], 'class="field select" readonly="true"');
											}
											else {
											echo form_dropdown('nip', $options, $value["nip"], 'class="field select" id="nip" onChange="asal(this)"');
											}
										?>
										<!-- onChange="getID(this)" -->
										</td>
										<td></td>
                                        <td><? echo form_error('nip');?></td>
                                    </tr>
									<tr>
                                        <td>Susunan Keluarga</td>
										<td></td>
										<td><input name="suskel" id="suskel" type="text" style="background:#99FFFF" readonly="true" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['suskel'] ?>"/></td>
                                        <td></td>
										<td></td>
                                    </tr>
									<tr>
                                        <td>NPWP</td>
										<td></td>
										<td><input name="npwp" id="npwp" type="text" style="background:#99FFFF" readonly="true" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['npwp'] ?>"/></td>
                                        <td></td>
										<td></td>
                                    </tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									
									<tr>
									<td class="judul" colspan="5"><p style="color:white;">GAJI</p></td>
									</tr>
                                    <tr>
                                        <td>Jumlah Hari Kerja</td>
										<td></td>
										<td><input name="hari_kerja" id="hari_kerja" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['hari_kerja'] ?>"/> Hari</td>
                                        <td></td>
										<td><? echo form_error('hari_kerja');?></td>
                                    </tr>
									<tr>
                                        <td>Jumlah Tidak Hadir</td>
										<td></td>
										<td><input name="tdk_hadir" id="tdk_hadir" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['tdk_hadir'] ?>"/> Hari </td>
                                        <td></td>
										<td><? echo form_error('tdk_hadir');?></td>
                                    </tr>
									<tr>
                                        <td>Jumlah Kehadiran</td>
										<td></td>
										<td><input name="hadir" id="hadir" style="background:#99FFFF" readonly="true" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['hadir'] ?>"/> Hari <input type="button" value="Hitung" onClick="hitungAbsen()"/></td>
                                        <td></td>
										<td></td>
                                    </tr>
									<tr>
                                        <td>Upah Pokok</td>
                                        <td>Rp.</td>
										<td><input name="pokok" id="pokok" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" onClick="pesanFormat()" value="<?= $value['pokok'] ?>"/></span></td>	
										<td></td>
										<td><? echo form_error('pokok');?></td>
									</tr>
									<tr>
                                        <td>Tunjangan Posisi</td>
										<td>Rp.</td>
										<td><input name="tunj_posisi" id="tunj_posisi" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['tunj_posisi'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('tunj_posisi');?></td>
                                    </tr>
									<tr>
                                        <td>Tunjangan Transportasi</td>
										<td>Rp.</td>
										<td><input name="tunj_transport_x" id="tunj_transport_x" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" onClick="pesanTransport()" value="<?= $value['tunj_transport_x'] ?>"/>  &nbsp = &nbsp </td>
                                        <td>Rp.</td>
										<td><input name="tunj_transport" id="tunj_transport" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['tunj_transport'] ?>"/></td>
                                    </tr>
									<tr>
                                        <td>Uang Makan</td>
										<td>Rp.</td>
										<td><input name="makan_x" id="makan_x" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" onClick="pesanMakan()" value="<?= $value['makan_x'] ?>"/> &nbsp = &nbsp </td>
                                        <td>Rp.</td>
										<td><input name="makan" id="makan" style="background:#99FFFF" readonly="true" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['makan'] ?>"/></td>
                                    </tr>
									<tr>
                                        <td>Lumpsum</td>
										<td>Rp.</td>
										<td><input name="lumpsum" id="lumpsum" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['lumpsum'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('lumpsum');?></td>
                                    </tr>
									<tr>
										<td>Tunjangan Lainnya</td>
										<td>Rp.</td>
										<td><input name="tunj_lainnya" id="tunj_lainnya" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['tunj_lainnya'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('tunj_lainnya');?></td> 
                                    </tr>
									<tr>
                                        <td>Suplisi</td>
										<td>Rp.</td>
										<td><input name="suplisi" id="suplisi" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['suplisi'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('suplisi');?></td>
                                    </tr>
									<tr>
                                        <td>THRK</td>
										<td>Rp.</td>
										<td><input name="thrk" id="thrk" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['thrk'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('thrk');?></td>
                                    </tr>
									<tr>
                                        <td>Tunjangan Jamsostek</td>
										<td>Rp.</td>
										<td><input name="tunj_jamsostek" id="tunj_jamsostek" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['tunj_jamsostek'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('tunj_jamsostek');?></td>
                                    </tr>
									<!-- 
									<tr>
									<td class="judul" colspan="3"><p style="color:white;">LEMBUR</p></td>
									</tr>
									
                                    <tr>
                                        <td colspan="2">Jumlah Lembur di Hari Kerja</td>
										<td><input name="jam_hk" id="jam_hk" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['jam_hk'] ?>"/> Jam</td>
                                        <td></td>
										<td><? echo form_error('jam_hk');?></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">Jumlah Lembur di Hari Libur</td>
										<td><input name="jam_hl" id="jam_hl" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="10" value="<?= $value['jam_hl'] ?>"/> Jam</td>
                                        <td></td>
										<td><? echo form_error('jam_hl');?></td>
                                    </tr>
									-->
									<tr>
                                        <td>Upah Lembur</td>
										<td>Rp.</td>
										<td><input name="lembur" id="lembur" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['lembur'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('lembur');?></td>
                                    </tr>
																		
									<tr>
										<td></td>
										<td></td>
                                        <td class="gaya2">Jumlah Gaji Kotor</td>
										<td width="25" align="right">Rp.</td>
										<td><input name="jml_gaji_kotor" id="jml_gaji_kotor" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['jml_gaji_kotor'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK()"/></td>
                                        
                                    </tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
									<td class="judul" colspan="5"><p style="color:white;">POTONGAN TETAP</p></td>
									</tr>
									<tr>
                                        <td>Jamsostek</td>
										<td></td>
										<td><input name="jamsostek_x" id="jamsostek_x" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="3" value="<?= $value['jamsostek_x'] ?>"/> % &nbsp = &nbsp Rp. <input name="jamsostek" id="jamsostek" readonly="true" style="background:#99FFFF" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="25" value="<?= $value['jamsostek'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('jamsostek_x');?></td>
                                    </tr>
									<tr>
                                        <td>Iuran DPLK</td>
										<td></td>
										<td><input name="iuran_dplk_x" id="iuran_dplk_x" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="3" value="<?= $value['iuran_dplk_x'] ?>"/>  % &nbsp  = &nbsp Rp. <input name="iuran_dplk" id="iuran_dplk" readonly="true" style="background:#99FFFF" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="25" value="<?= $value['iuran_dplk'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('iuran_dplk_x');?></td>
                                    </tr>
									<tr>
										<td></td>
										<td></td>
                                        <td class="gaya">Jumlah Potongan Tetap</td>
										<td align="right">Rp.</td>
										<td><input name="jml_potongan_tetap" id="jml_potongan_tetap" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['jml_potongan_tetap'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT()"/></td>
                                        
                                    </tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									
									<tr>
									<td class="judul" colspan="5"><p style="color:white;">PERHITUNGAN PPH 21</p></td>
									</tr>
									<tr>
                                        <td>PH Bruto</td>
										<td>Rp.</td>
										<td><input name="netto_setahun" id="netto_setahun" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['netto_setahun'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('netto_setahun');?></td>
                                    </tr>
									<tr>
                                        <td>PTKP</td>
										<td>Rp.</td>
										<td><input name="ptkp" id="ptkp" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['ptkp'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('ptkp');?></td>
                                    </tr>
									<tr>
                                        <td>PH Netto</td>
										<td>Rp.</td>
										<td><input name="pkp_setahun" id="pkp_setahun" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pkp_setahun'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pkp_setahun');?></td>
                                    </tr>									
									<tr>
                                        <td>PKP</td>
										<td>Rp.</td>
										<td><input name="pkp" id="pkp" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pkp'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pkp');?></td>
                                    </tr>
									<tr>
                                        <td>PPH Terhutang</td>
										<td>Rp.</td>
										<td><input name="pkp_sebulan" id="pkp_sebulan" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pkp_sebulan'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pkp_sebulan');?></td>
                                    </tr>
									
									<tr>
                                        <td>PPH 21</td>
										<td>Rp.</td>
										<td><input name="pph21" id="pph21" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pph21'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT(); hitungNS(); hitungPKPth(); hitungPKP(); hitungPKPbln(); hitungPPH21()"/></td>
                                        <td></td>
										<td><? echo form_error('pph21');?></td>
                                    </tr>
									<tr>
										<td></td>
                                        <td></td>
										<td class="gaya2">Jumlah Gaji Bersih</td>
										<td align="right">Rp.</td>
										<td><input name="jml_gaji_bersih" id="jml_gaji_bersih" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['jml_gaji_bersih'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT(); hitungNS(); hitungPKPth(); hitungPKP(); hitungPKPbln(); hitungPPH21(); hitungGB()"/></td>
                                        
                                    </tr>
									
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									
									<tr>
									<td class="judul" colspan="5"><p style="color:white;">POTONGAN LAIN-LAIN</p></td>
									</tr>
									<tr>
                                        <td>Simpanan Wajib</td>
										<td>Rp.</td>
										<td><input name="simp_wajib" id="simp_wajib" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['simp_wajib'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('simp_wajib');?></td>
                                    </tr>
									<tr>
                                        <td>Pinjaman Jangka Pendek</td>
										<td>Rp.</td>
										<td><input name="pinj_pendek" id="pinj_pendek" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pinj_pendek'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pinj_pendek');?></td>
                                    </tr>
									<tr>
                                        <td>Pinjaman Jangka Panjang</td>
										<td>Rp.</td>
										<td><input name="pinj_panjang" id="pinj_panjang" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pinj_panjang'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pinj_panjang');?></td>
                                    </tr>
									<tr>
                                        <td>Pinjaman Lainnya</td>
										<td>Rp.</td>
										<td><input name="pinj_lain" id="pinj_lain" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['pinj_lain'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('pinj_lain');?></td>
                                    </tr>
									<tr>
                                        <td>Potongan Lainnya (Jamsostek)</td>
										<td>Rp.</td>
										<td><input name="potongan_lain" id="potongan_lain" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['potongan_lain'] ?>"/></td>
                                        <td></td>
										<td><? echo form_error('potongan_lain');?></td>
                                    </tr>
									<tr>
										<td></td>
										<td></td>
                                        <td class="gaya">Jumlah Potongan Lain-Lain</td>
										<td align="right">Rp.</td>
										<td><input name="jml_potongan_lain" id="jml_potongan_lain" style="background:#99FFFF" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['jml_potongan_lain'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT(); hitungNS(); hitungPKPth(); hitungPKP(); hitungPKPbln(); hitungPPH21(); hitungGB(); hitungPL()"/></td>
                                        
                                    </tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>&nbsp;</td>
										<td class="gaya3" colspan="2"><p style="color:white;">JUMLAH GAJI YANG DITERIMA</p></td>
										<td align="right">Rp.</td>
										<td><input name="jml_gaji_akhir" id="jml_gaji_akhir" style="background:yellow" readonly="true" type="text" <? if ($status=="detail") {echo 'disabled="true"';} ?> size="30" value="<?= $value['jml_gaji_akhir'] ?>"/> <input type="button" value="Hitung" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT(); hitungNS(); hitungPKPth(); hitungPKP(); hitungPKPbln(); hitungPPH21(); hitungGB(); hitungPL(); hitungGA()"/><? echo form_error('jml_gaji_akhir');?></td>
                                    </tr>
									<tr>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
										<td>&nbsp;</td>
									</tr>
                                    
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td></td>
										
										<td>
                                            <div align="left">
												<?
														if ($status == "detail") {
														echo '';
														}
														else {
														echo '<input type="submit" name="Submit" value="Simpan" onClick="hitungAbsen();  hitungTM();  hitungGK(); hitungPT(); hitungNS(); hitungPKPth(); hitungPKP(); hitungPKPbln(); hitungPPH21(); hitungGB(); hitungPL(); hitungGA()" />';
														}
												?>
                                                
														
												<input type='button' value='Kembali' onclick='javascript:history.back();'>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </form>        
                        <p align="center">&nbsp;</p></td></tr>
            </table>
        </div>
        <p>&nbsp;</p>
    </fieldset>
</div> 
<p>
    <!--container-->
</p>
<p>&nbsp; </p>
